package org.zcq100.GUI;
import java.awt.FlowLayout;

import javax.swing.*;
public class Demo_JList extends JFrame{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public Demo_JList(){
		setSize(100, 100);
		setDefaultCloseOperation(3);
		setLayout(new FlowLayout());
		list1=new JList(new String[]{"aaa","bbb","ccc"});
		list2=new JList(new String[]{"111","2222","3333"});
		list1.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		list2.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
		add(list1);
		add(list2);
	}
	public static void main(String[] args) {
		Demo_JList demo=new Demo_JList();
		demo.setVisible(true);
	}
	private JList list1;
	private JList list2;
}
